;(function(win) {
	var AIEngine = function() {
		return new AIEngine.init();
	}
	
	var aiEngineProps = AIEngine.prototype;
	AIEngine.init = function() {};
	AIEngine.init.prototype = aiEngineProps;
	AIEngine.version ={};
	AIEngine.version.number = "1.0.0.RELEASE";
	AIEngine.version.author = "yumi@omuao.com";
	aiEngineProps.setWorldOptions = function(options) {
		this.worldOptions = options;
	}
	
	win.AIEngine = AIEngine;
	
	//初始化人工智能引擎
	if(win.JadeEngine != null && typeof win.JadeEngine !== "undefined" ){
		JadeEngine.World.prototype.setAIEngine = function(aiEngine){
			if(!aiEngine instanceof AIEngine){
				throw "AIEngine is not set";
			}
			aiEngine.setWordOptions(this);
			this.aiEngine = aiEngine;
			return this.aiEngine;
		}
		JadeEngine.World.prototype.getAIEngine = function(){
			if(this.aiEngine == null || typeof this.aiEngine === "undefined") {
				this.aiEngine = new AIEngine();
				this.aiEngine.setWorldOptions(this);
			}
			return this.aiEngine;
		}
		JadeEngine.World.prototype.getAIEngineVersionInfo = function(){
			return AIEngine.version;
		}
	}
}(window));